<?php

namespace app\api\controller;

use app\api\service\CaptchaService;
use app\api\validate\CaptchaValidate;
use think\response\Json;

class Sms extends ApiController
{
    /**
     * 发送手机验证码
     * @return Json
     */
    public function sendSmsCode()
    {
        $params = (new CaptchaValidate())->post()->checkParam('check');
        $res = CaptchaService::sendSmsCode($params);
        if($res) {
            return $this->success([]);
        } else {
            return $this->error(CaptchaService::getError());
        }
    }
}